//
//  WSTextFiled.m
//  WisdomStar
//
//  Created by 谭飞 on 2018/10/24.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "WSTextFiled.h"

@implementation WSTextFiled

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setup];
}

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setup];
    }
    return self;
}

- (void)setup {

    self.tintColor = kThemeGreenColor;
    self.textColor = kFontColorBlack;
    self.placeholderColor = kFontColorGray;
}


// 设置占位文字位置
- (CGRect)placeholderRectForBounds:(CGRect)bounds {
    return CGRectMake(5.f, bounds.origin.y, bounds.size.width, bounds.size.height);
}

// 设置光标位置
- (CGRect)editingRectForBounds:(CGRect)bounds {
    return CGRectMake(5.f, bounds.origin.y, bounds.size.width, bounds.size.height);
}

// 设置内容位置
- (CGRect)textRectForBounds:(CGRect)bounds {
    return CGRectMake(5.f, bounds.origin.y, bounds.size.width, bounds.size.height);
}

@end
